#ifndef __K2D_ENGINE_H__
#define __K2D_ENGINE_H__

class Engine
{
public:
	// pass the necessary virables to engine directly
	//-----------------------------------------------
	// userdata struct
	// 1. window handler
	// 2. DC     handler
	// 3. Font   handler
	// 4. Screen width
	// 5. Screen height
	//-----------------------------------------------
	Engine(void* userdata []);

	// make sure this is a virtual function
	virtual ~Engine();

public:
	// Init all necessary resource
	virtual int Init( void ) = 0;

	// Release all resource 
	virtual void Free( void ) = 0;

	// 
	virtual void Stop( void ) = 0;

	// 
	virtual void Resume( void ) = 0;

protected:
	// Game logic before render
	virtual void ExecB( void ) = 0;

	// Game logic after render
	virtual void ExecA( void ) = 0;

	// Pre-Render process
	virtual void PreRender( void ) = 0;

	// Render process
	virtual void Render( void ) = 0;

	// Post-Render process
	virtual void PostRender( void ) = 0;

public:
	// Standard game frame
	void OneFrame( void );

	// Exit
	void Exit( void );

public:
	// Screen width (render area)
	int m_nScreenWidth;

	// Screen height (render area)
	int m_nScreenHeight;

private:
	// Dispaly handler
	void* m_hDisplay;

	// Surface handler
	void* m_hSurface;

	// Configuration handler
	void* m_hConfig;

	// Context handler
	void* m_hContext;
};

#endif